package com.cristina.attention.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cristina.attention.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户
 * @Author superman
 * @Date 2021/10/7 17:19
 **/
@Data
@TableName(value = "im_user")
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"password"})
public class User extends BaseEntity {

    public static final String IMAGE = "https://p.qqan.com/up/2021-10/16332291759371824.jpg";
    public static final Integer DEFAULT_SEX = 0;

    /**
     * 唯一标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 密码
     */
    @TableField(value = "password")
    @JSONField(serialize = false)
    private String password;

    /**
     * 登录用户名 - 由用户注册 - (需返回)
     */
    @TableField(value = "username")
    private String username;

    /**
     * 昵称, 暂且跟用户名一致
     */
    @TableField(value = "nickname")
    private String nickname;

    /**
     * IMid, 生成IMid, 做唯一标识 - (需返回)
     */
    @TableField(value = "im_id")
    private String imId;

    /**
     * 姓名首字母
     */
    @TableField(value = "initial")
    private String initial;

    /**
     * 头像 - (需返回)
     */
    @TableField(value = "img")
    private String img;

    /**
     * 个性签名
     */
    @TableField(value = "signature")
    private String signature;

    /**
     * 性别 1为男，0为女
     */
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 备注 - 好友备注 - 默认与用户名一致
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 地区
     */
    @TableField(value = "area")
    private String area;

    /**
     * channelId - 连接通道 id - (需返回)
     */
    @TableField(exist = false)
    private String channelId;

    @TableField(exist = false)
    private String email;

    /**
     * 唯一标识 - 随机生成,
     */
    @TableField(value = "open_id")
    private String openId;

    /**
     * 账号状态, 系统回检测不良行为, 将账号停用
     */
    @TableField(value = "enabled")
    private Boolean enabled = true;

    /**
     * 用于索引
     */
    @TableField(value = "id")
    private Integer id = 0;
    @TableField(value = "`index`")
    private Integer index = 0;

    public User() {
    }

}
